/*
 * @Description: 选择车票时间的单一时间组件
 * @Author: shuaishuai.wang
 * @Date: 2019-08-21 09:41:07
 * @Last Modified by: ziwei.ma
 * @Last Modified time: 2019-10-17 14:58:09
 */
<template>
  <div
    class="time_main"
    :class="selected ? 'selected_time' : ''"
  >
    <div class="time_big fontsize40">{{this.$parent.typeIndex === 2? time.DATE_CN: time.DATE_NUM}}</div>
    <div class="time_small fontsize28">{{this.$parent.typeIndex === 2?time.DATE_NUM: time.DATE_CN}}</div>
    <div class="time_choose">
      <i
        class="iconfont fontsize20"
        :class="selected ? 'icon-circle-o' : 'icon-circle'"
      ></i>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    time: { // 时间数据
      type: Object,
      default: null
    },
    selected: false // 当前日期是否已选择
  },
  mounted() {
    console.log('typeIndex--->', this.$parent.$parent.typeIndex)
  }
}
</script>

<style lang="scss" scoped>
.time_main {
  box-sizing: border-box;
  width: 136px;
  border-radius: 8px;
  background-color: #f2f5f6;
  text-align: center;
  margin-right: 24px;
  .time_big {
    height: 76px;
    line-height: 76px;
    color: #333;
  }
  .time_small {
    height: 50px;
    line-height: 32px;
    color: #999;
  }
  .time_choose {
    padding-bottom: 5px;
  }
}

.selected_time {
  border: 2px solid #027aff; /*no*/
  .icon-circle-o {
    color: #027aff;
  }
}
</style>
